package com.dsh.expressSetting.controller;

import com.dsh.expressSetting.entity.ExpressSetting;
import com.dsh.expressSetting.entity.RuleVo;
import com.dsh.expressSetting.service.ExpressSettingService;
import com.dsh.model.Result;
import com.dsh.payMethod.entity.ChargeEntity;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 快递设置(ExpressSetting)表控制层
 *
 * @author makejava
 * @since 2022-05-12 15:13:52
 */
@Api(tags = "快递费用设置")
@RestController
@RequestMapping("expressSetting")
public class ExpressSettingController {
    /**
     * 服务对象
     */
    @Resource
    private ExpressSettingService expressSettingService;

    @ApiOperation(value = "收费处理",response = ExpressSetting.class)
    @GetMapping("selectOne")
    public Result selectOne(){
        ExpressSetting expressSetting = expressSettingService.selectOne();
        return Result.success(expressSetting,"");
    }
    @ApiOperation(value = "快递设置",response = ExpressSetting.class)
    @GetMapping("selectRule")
    public Result selectRule(int page,int limit){
        PageInfo<RuleVo> ruleVoPageInfo = expressSettingService.selectRule(page, limit);
        return Result.success(ruleVoPageInfo,"");
    }

}